<?php
//$update = Midp::getInstance('update');
include _path("class/query");
$postdata = query::getformdata();

//print_r($postdata);
if($action=='submitform'){
	include _path('class/token');
	if(!Token::check()){
		exit('禁止重复提交或者通过外路提交');
	}
	
	unset($postdata[1]['repassword'], $postdata[1]['submit']);
	$postdata[1]['password'] = md5($postdata[1]['password']);
	if(!data::check('users', array('username'=>$postdata[1]['username']))){
		data::insert('users', $postdata[1]);
		//warnpage();
	}else{
		exit('repeat data!');
	}
	echo "insert user ok!";
}
?>